package com.wym.learning;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Wu_youming on 2015/4/27.
 * Everyday is another day, keep going.
 */
public class MusicModel implements Parcelable {
    private String name;
    private String title;
    private int duration;
    private String artist;
    private String data;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public String getArtist() {
        return artist;
    }

    public void setArtist(String artist) {
        this.artist = artist;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public MusicModel(){

    }
    public MusicModel(Parcel source) {
        name = source.readString();
        title = source.readString();
        duration = source.readInt();
        artist = source.readString();
        data = source.readString();
    }

    public static final Creator<MusicModel> CREATOR = new Creator<MusicModel>() {
        @Override
        public MusicModel createFromParcel(Parcel source) {
            return new MusicModel(source);
        }

        @Override
        public MusicModel[] newArray(int size) {
            return new MusicModel[size];
        }
    };

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeString(title);
        dest.writeInt(duration);
        dest.writeString(artist);
        dest.writeString(data);
    }
}
